<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增医疗器械入库记录')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-apparatus_inStorage-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">入库时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="time" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">供货单位：</label>
                <div class="col-sm-8">
                    <input name="supplier" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">产品名称：</label>
                <div class="col-sm-8">
                    <select class="form-control" name="name" id="name">
                        <option value=""></option>
                        <option th:each="apparatus:${apparatuses}" th:text="${apparatus.getName()}" th:value="${apparatus.getName()}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">规格：</label>
                <div class="col-sm-8">
                    <input name="standard" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">单位：</label>
                <div class="col-sm-8">
                    <input name="unit" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">购进数量：</label>
                <div class="col-sm-8">
                    <input name="number" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">生产企业：</label>
                <div class="col-sm-8">
                    <input name="producer" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">许可证号：</label>
                <div class="col-sm-8">
                    <input name="permissionNum" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">注册证号：</label>
                <div class="col-sm-8">
                    <input name="registerNum" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">生产批号：</label>
                <div class="col-sm-8">
                    <input name="batchNum" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">灭菌批号：</label>
                <div class="col-sm-8">
                    <input name="sterilisatioNum" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">有效期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="deadline" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">质量情况：</label>
                <div class="col-sm-8">
                    <input name="quality" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">价格：</label>
                <div class="col-sm-8">
                    <input name="price" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">发票号码：</label>
                <div class="col-sm-8">
                    <input name="receipt" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "wm/apparatus_inStorage"
        $("#form-apparatus_inStorage-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-apparatus_inStorage-add').serialize());
            }
        }

        $("input[name='time']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='deadline']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>